package com.itheima.args;

import java.util.Arrays;
import java.util.List;

public class ArgsDemo01 {

    public static void main(String[] args) {

        String[] s = {"张三", "李四", "王五"};

        List<String> strings = Arrays.asList(s);

        //strings.add("赵六");          //UnsupportedOperationException  不允许进行添加操作
        //strings.remove("张三");       //UnsupportedOperationException: remove  不允许进行删除操作
        strings.set(2, "王麻子");       //可以进行修改操作

        System.out.println(strings);

        System.out.println("-------------------------------------------------------");

        String[] s1 = {"赵六", "钱大", "孙小"};

        List<String> list = List.of(s1);

        //list.add("周二");            //UnsupportedOperationException   不允许进行添加操作
        //list.remove(0);             //UnsupportedOperationException    不允许进行删除操作
        //list.set(0, "吴钩");        //UnsupportedOperationException    不允许进行修改操作

        System.out.println(list);

    }

}
